package com.zhang.gitxuexi;

public class ComputeFactory {


//    public static final Add ADD = new Add(); 使用ctrl+alt+C
    private static final Sub sub = new Sub();
    private static final Add add = new Add();

    public static Computable getComputable(String symbol) throws ClassNotFoundException, IllegalAccessException, InstantiationException {
        return (Computable) Class.forName(symbol).newInstance();
    }
}
